package com.vf.admin.miaodong.controller;

import com.vf.admin.common.BaseController;
import com.vf.admin.common.Constants;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppOpLog;
import com.vf.admin.miaodong.service.AfterOpLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>Title : </p>
 * <p>Description : </p>
 * <p>DevelopTools : IDEA</p>
 * <p>DevelopSystem : Windows11</p>
 *
 * @Author : zxw
 * @Date 2023/8/14 8:49
 */
@Controller
@RequestMapping("/after/oplog")
public class AfterOpLogController extends BaseController {


    @Autowired
    AfterOpLogService afterOpLogService;


    @RequestMapping("/list")
    public String getAllUser(SplitPageBean splitPage, Integer status, String usercode, String mobileSpec, String imei ,String startDate,
                             String endDate) {
        Map<String, Object> map = new HashMap<>();
        map.put("status", status);
        map.put("usercode", usercode);
        map.put("mobileSpec", mobileSpec);
        map.put("startDate", startDate);
        map.put("endDate", endDate);
        map.put("imei", imei);
        Map<Integer, String> statusMap = Constants.getopNameMap();
        List<AppOpLog> maps = afterOpLogService.findList(map, splitPage);
        request.setAttribute("list", maps);
        request.setAttribute("splitPage", splitPage);
        request.setAttribute("statusMap", statusMap);
        request.setAttribute("usercode", usercode);
        request.setAttribute("mobileSpec", mobileSpec);
        request.setAttribute("startDate", startDate);
        request.setAttribute("endDate", endDate);
        request.setAttribute("imei", imei);

        return this.sucess("/web/after/oplog/list");
    }
}
